import { useBoolean, useMount } from "ahooks";

const useDelay = (time = 500) => {
  const [state, { setTrue }] = useBoolean(false);

  useMount(() => {
    setTimeout(() => {
      setTrue();
    }, time);
  });

  return [state, { setTrue }];
};

export default useDelay;
